package org.nepu.scr.indexrate.converter.upgraderate.operationreliability;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.upgraderate.operationreliability.AppendixC3;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class AppendixC3Converter implements AttributeConverter<AppendixC3, String> {
    @Override
    public String convertToDatabaseColumn(AppendixC3 appendixC3) {
        return JSONUtil.toJsonStr(appendixC3);
    }

    @Override
    public AppendixC3 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, AppendixC3.class);
    }
}
